// store/module/register.ts
import { Module } from "vuex";
import { RootState } from "../index";

export interface RegisterState {
    user: {
        id: number;
        username: string;
        avatar: string;
        gender: number;
        email: string;
        phone: string;
    };
}

export const register: Module<RegisterState, RootState> = {
    namespaced: true,
    state() {
        return {
            user: {
                id: 0,
                username: "",
                avatar: "",
                gender: 0,
                email: "",
                phone: "",
            },
        };
    },
    getters: {},
    mutations: {},
    actions: {}
}

export default register;
export type RegisterMutations = typeof register.mutations;  // 导出 mutations 类型
export type RegisterActions = typeof register.actions;      // 导出 actions 类型